import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)
// 1.1导入登录注册组件
import Reg from '@/views/Reg/Reg.vue'
import Login from '@/views/Login/Login.vue'
import Main from '@/views/Main/Main.vue'

// 1.2定义路由规则
const routes = [
  // 1.3 注册的路由
  { path: '/reg',name:Reg,component: Reg },
  // 1.4 登录的路由
  { path: '/login', name:Login,component: Login },
  // 首页的路由
  { path: '/', name:Main,component: Main, }
]

// 创建路由实例对象
const router = new VueRouter({
  routes
})

// 导出路由对象
export default router
